package com.holy.sh.module_base_mvp.constants;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;

import com.google.gson.Gson;
import com.holy.sh.module_base_mvp.helper.SpfHelper;

import okhttp3.OkHttpClient;

/**
 * Holy Email :victorhhl@163.com
 * Create by Holy on 2019/5/15
 * Description :
 */
public class BaseApplication extends Application {

    private static volatile OkHttpClient okHttpClient;
    private static volatile Context context;
    private static volatile BaseApplication instence;
    private static volatile Gson gson = null;
    private SharedPreferences sharedPreferences;
    private static volatile SpfHelper spfHelper;


    @Override
    public void onCreate() {
        super.onCreate();

    }

    public static BaseApplication getInstance(){
        return instence;
    }


    /**
     * SpfHelper 单例
     */
    public SpfHelper getSpfHelper() {
        if (spfHelper == null) {
            synchronized (SpfHelper.class) {
                if (spfHelper == null) {
                    spfHelper = new SpfHelper(this, ConstantsApi.SP_NAME);
                }
            }
        }
        return spfHelper;
    }

}
